﻿Module modAlarms

    Public Sub RaiseAlarm(ByVal IsLog As Boolean, ByVal IsMsg As Boolean, ByVal IsObj As Boolean, Optional ByVal AlarmUnit As String = Nothing,
                          Optional ByVal AlarmDesc As String = Nothing, Optional ByVal BatchID As Integer = Nothing,
                          Optional ByVal Msg As String = Nothing, Optional ByVal Ctrl As Control = Nothing)
        If IsLog = True Then
            InsertAlarm(AlarmUnit, AlarmDesc, DateTime.Now, BatchID)
        End If

        If IsMsg = True Then
            MessageBox.Show(Msg, "Alarm !", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If

        If IsObj = True Then
            Ctrl.Text = Msg
        End If

    End Sub



End Module
